<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>3-一次设置多个事件</title>
		<!-- 导入jquery库 -->
		<script type="text/javascript" src="js/jquery2.1.4.min.js"></script>
		<style type="text/css">
			div{
				width:100px;
				height:100px;
				line-height:100px;
				text-align: center;
				color:#fff;
				font-size:20px;
				background:#000;
			}
			.cur{
				background:red;
			}
			.del{
				background:orange;
			}
		</style>
	</head>
	<body>
		<div>百度</div>
		<script type="text/javascript">
			/**
			 * document.querySelector('.box').onclick=function(){}
			 * document.querySelector('.box').addEventListener('click',function(){})
			 * document.querySelector('.box').addEventListener('mouseover',function(){})
			 */ 
			$(function(){
				$('div').on({
					click:function(){
						console.log('click');
						$(this).css('background','red').text('新浪');
					},
					mouseover:function(){
						console.log('mouseover');
						$(this).css('background','blue').text('百度');
					},
					mouseout:function(){
						console.log('mouseout');
						$(this).css('background','orange').text('阿里');
					}
				});
			});
		</script>
	</body>
</html>
